home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-02-07 | 3.9 KB | 131 lines | [TEXT/MPS ] |
- UNIT UMenuHandler;
-
- {-------------------------------------------------------------------------------
- #
- # Apple Macintosh Developer Technical Support
- #
- # Interfaces for the menu-handling routines
- #
- # Program: ProcDoggie
- # File: UMenuHandler.p - Pascal Implementation
- #
- # by: Forrest Tanaka
- #
- # Copyright © 1988-1991 Apple Computer, Inc.
- # All rights reserved.
- #
- --------------------------------------------------------------------------------
- #
- # All of the code in this module is used to maintain the menus and to handle
- # menu selections by the user.
- #
- -------------------------------------------------------------------------------}
- {[j=20/57/1$] Pasmat Options}
-
-
- INTERFACE
-
-
- (*******************************************************************************
- * Used Units
- *******************************************************************************)
-
- USES
- (* Group 1 *)
- Types
- ,QuickDraw
-
- (* Group 2 *)
- ,Controls
- ,Errors
- ,Events
- ,Memory
- ,Menus
- ,Resources
- ,SegLoad
- ,TextEdit
- ,ToolUtils
-
- (* Group 3 *)
- ,Desk
- ,Processes
- ,Windows
-
- (* Group 4 *)
- ,Dialogs
-
- (* Application *)
- ,UGlobals
- ,UProcessUtils
- ,UProcessGuts
- ;
-
-
- (*******************************************************************************
- * Constants
- *******************************************************************************)
-
- CONST
- mApple = 128; {Menu ID and resource ID of Apple menu}
- iAbout = 1; {Menu item number of About SevenPaint item}
-
- mFile = 129; {Menu ID and resource ID of File menu}
- iLaunchFore = 1; {Menu item number of Launch to Foreground… item}
- iLaunchBack = 2; {Menu item number of Launch to Background… item}
- iLaunchTo = 3; {Menu item number of Launch To… item}
- iJustLaunch = 5; {Menu item number of Simple Launch item}
- iOpenLaunch = 6; {Menu item number of Open Documents on Launch item}
- iPrintLaunch = 7; {Menu item number of Print Documents on Launch item}
- iQuit = 9; {Menu item number of Quit item}
-
- mProcess = 130; {Menu ID and resource ID of Process menu}
- iBringFront = 1; {Menu item number of Bring Process to Front item}
- iShowProcessInfo = 2; {Menu item number of Show Process Info item}
- iTerminateProcess = 3; {Menu item number of Terminate Process item}
-
-
- (*******************************************************************************
- * StartMenus - Do additional initialization of the menus
- *
- * This routine is called just after calling the Utilities sample code routine,
- * StandardMenuSetup. This application needs to do just a little bit of
- * additional initialization for menus. See UMenuHandler.inc1.p for details.
- *
- * If there isn’t enough memory to load the menus, then the gError global is set
- * to memFullErr. If desired menu resources couldn’t be found, then gError is
- * set to resNotFound. If any other error occurs, then gError is set to
- * dsSysErr.
- *******************************************************************************)
-
- PROCEDURE StartMenus;
-
-
- (*******************************************************************************
- * DoMenuChoice - Dispatch to the appropriate routine for a menu choice
- *
- * When it’s determined that a menu item was chosen, this routine is called to
- * dispatch to the appropriate routine for the chosen menu item. The menu item
- * and menu number returned by MenuSelect and MenuKey is passed in the menuChoice
- * parameter.
- *******************************************************************************)
-
- PROCEDURE DoMenuChoice (menuChoice: LongInt);
-
-
- (*******************************************************************************
- * FixMenus - Fix menus so that proper items are enabled and marked
- *
- * FixMenus is called to assure that menu items are disable, enabled, marked, and
- * unmarked appropriately. It’s called at the end of every iteration of the main
- * event loop.
- *******************************************************************************)
-
- PROCEDURE FixMenus;
-
-
- IMPLEMENTATION
-
- {$I UMenuHandler.inc1.p}
-
- END.
-